/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "napi_web_net_errorcode.h"

#include "arkweb_net_error_list.h"

namespace OHOS::NWeb {
namespace {
napi_value ToInt32Value(napi_env env, int32_t number)
{
    napi_value result = nullptr;
    napi_create_int32(env, number, &result);
    return result;
}

napi_value CreateEnumConstructor(napi_env env, napi_callback_info info)
{
    napi_value arg = nullptr;
    napi_get_cb_info(env, info, nullptr, nullptr, &arg, nullptr);
    return arg;
}
} // namespace

#define NAPI_NET_ERROR_CODE(codeName, code)                                     \
    DECLARE_NAPI_STATIC_PROPERTY(                                               \
        codeName,                                                               \
        ToInt32Value(                                                           \
            env,                                                                \
            static_cast<int32_t>(code)))


void NapiWebNetErrorCode::ExportWebNetErrorCode(napi_env env, napi_value* exportsPointer)
{
    napi_value webNetErrorCode = nullptr;
    napi_property_descriptor properties[] = {
        NAPI_NET_ERROR_CODE("NET_OK", ArkWeb_NetError::ARKWEB_NET_OK),
        NAPI_NET_ERROR_CODE("ERR_IO_PENDING",
            ArkWeb_NetError::ARKWEB_ERR_IO_PENDING),
        NAPI_NET_ERROR_CODE("ERR_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_FAILED),
        NAPI_NET_ERROR_CODE("ERR_ABORTED",
            ArkWeb_NetError::ARKWEB_ERR_ABORTED),
        NAPI_NET_ERROR_CODE("ERR_INVALID_ARGUMENT",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_ARGUMENT),
        NAPI_NET_ERROR_CODE("ERR_INVALID_HANDLE",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_HANDLE),
        NAPI_NET_ERROR_CODE("ERR_FILE_NOT_FOUND",
            ArkWeb_NetError::ARKWEB_ERR_FILE_NOT_FOUND),
        NAPI_NET_ERROR_CODE("ERR_TIMED_OUT",
            ArkWeb_NetError::ARKWEB_ERR_TIMED_OUT),
        NAPI_NET_ERROR_CODE("ERR_FILE_TOO_LARGE",
            ArkWeb_NetError::ARKWEB_ERR_FILE_TOO_LARGE),
        NAPI_NET_ERROR_CODE("ERR_UNEXPECTED",
            ArkWeb_NetError::ARKWEB_ERR_UNEXPECTED),
        NAPI_NET_ERROR_CODE("ERR_ACCESS_DENIED",
            ArkWeb_NetError::ARKWEB_ERR_ACCESS_DENIED),
        NAPI_NET_ERROR_CODE("ERR_NOT_IMPLEMENTED",
            ArkWeb_NetError::ARKWEB_ERR_NOT_IMPLEMENTED),
        NAPI_NET_ERROR_CODE("ERR_INSUFFICIENT_RESOURCES",
            ArkWeb_NetError::ARKWEB_ERR_INSUFFICIENT_RESOURCES),
        NAPI_NET_ERROR_CODE("ERR_OUT_OF_MEMORY",
            ArkWeb_NetError::ARKWEB_ERR_OUT_OF_MEMORY),
        NAPI_NET_ERROR_CODE("ERR_UPLOAD_FILE_CHANGED",
            ArkWeb_NetError::ARKWEB_ERR_UPLOAD_FILE_CHANGED),
        NAPI_NET_ERROR_CODE("ERR_SOCKET_NOT_CONNECTED",
            ArkWeb_NetError::ARKWEB_ERR_SOCKET_NOT_CONNECTED),
        NAPI_NET_ERROR_CODE("ERR_FILE_EXISTS",
            ArkWeb_NetError::ARKWEB_ERR_FILE_EXISTS),
        NAPI_NET_ERROR_CODE("ERR_FILE_PATH_TOO_LONG",
            ArkWeb_NetError::ARKWEB_ERR_FILE_PATH_TOO_LONG),
        NAPI_NET_ERROR_CODE("ERR_FILE_NO_SPACE",
            ArkWeb_NetError::ARKWEB_ERR_FILE_NO_SPACE),
        NAPI_NET_ERROR_CODE("ERR_FILE_VIRUS_INFECTED",
            ArkWeb_NetError::ARKWEB_ERR_FILE_VIRUS_INFECTED),
        NAPI_NET_ERROR_CODE("ERR_BLOCKED_BY_CLIENT",
            ArkWeb_NetError::ARKWEB_ERR_BLOCKED_BY_CLIENT),
        NAPI_NET_ERROR_CODE("ERR_NETWORK_CHANGED",
            ArkWeb_NetError::ARKWEB_ERR_NETWORK_CHANGED),
        NAPI_NET_ERROR_CODE("ERR_BLOCKED_BY_ADMINISTRATOR",
            ArkWeb_NetError::ARKWEB_ERR_BLOCKED_BY_ADMINISTRATOR),
        NAPI_NET_ERROR_CODE("ERR_SOCKET_CONNECTED",
            ArkWeb_NetError::ARKWEB_ERR_SOCKET_CONNECTED),
        NAPI_NET_ERROR_CODE("ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_CONTEXT_SHUT_DOWN",
            ArkWeb_NetError::ARKWEB_ERR_CONTEXT_SHUT_DOWN),
        NAPI_NET_ERROR_CODE("ERR_BLOCKED_BY_RESPONSE",
            ArkWeb_NetError::ARKWEB_ERR_BLOCKED_BY_RESPONSE),
        NAPI_NET_ERROR_CODE("ERR_CLEARTEXT_NOT_PERMITTED",
            ArkWeb_NetError::ARKWEB_ERR_CLEARTEXT_NOT_PERMITTED),
        NAPI_NET_ERROR_CODE("ERR_BLOCKED_BY_CSP",
            ArkWeb_NetError::ARKWEB_ERR_BLOCKED_BY_CSP),
        NAPI_NET_ERROR_CODE("ERR_H2_OR_QUIC_REQUIRED",
            ArkWeb_NetError::ARKWEB_ERR_H2_OR_QUIC_REQUIRED),
        NAPI_NET_ERROR_CODE("ERR_BLOCKED_BY_ORB",
            ArkWeb_NetError::ARKWEB_ERR_BLOCKED_BY_ORB),
        NAPI_NET_ERROR_CODE("ERR_CONNECTION_CLOSED",
            ArkWeb_NetError::ARKWEB_ERR_CONNECTION_CLOSED),
        NAPI_NET_ERROR_CODE("ERR_CONNECTION_RESET",
            ArkWeb_NetError::ARKWEB_ERR_CONNECTION_RESET),
        NAPI_NET_ERROR_CODE("ERR_CONNECTION_REFUSED",
            ArkWeb_NetError::ARKWEB_ERR_CONNECTION_REFUSED),
        NAPI_NET_ERROR_CODE("ERR_CONNECTION_ABORTED",
            ArkWeb_NetError::ARKWEB_ERR_CONNECTION_ABORTED),
        NAPI_NET_ERROR_CODE("ERR_CONNECTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_CONNECTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_NAME_NOT_RESOLVED",
            ArkWeb_NetError::ARKWEB_ERR_NAME_NOT_RESOLVED),
        NAPI_NET_ERROR_CODE("ERR_INTERNET_DISCONNECTED",
            ArkWeb_NetError::ARKWEB_ERR_INTERNET_DISCONNECTED),
        NAPI_NET_ERROR_CODE("ERR_SSL_PROTOCOL_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_SSL_PROTOCOL_ERROR),
        NAPI_NET_ERROR_CODE("ERR_ADDRESS_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_ADDRESS_INVALID),
        NAPI_NET_ERROR_CODE("ERR_ADDRESS_UNREACHABLE",
            ArkWeb_NetError::ARKWEB_ERR_ADDRESS_UNREACHABLE),
        NAPI_NET_ERROR_CODE("ERR_SSL_CLIENT_AUTH_CERT_NEEDED",
            ArkWeb_NetError::ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NEEDED),
        NAPI_NET_ERROR_CODE("ERR_TUNNEL_CONNECTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_TUNNEL_CONNECTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_NO_SSL_VERSIONS_ENABLED",
            ArkWeb_NetError::ARKWEB_ERR_NO_SSL_VERSIONS_ENABLED),
        NAPI_NET_ERROR_CODE("ERR_SSL_VERSION_OR_CIPHER_MISMATCH",
            ArkWeb_NetError::ARKWEB_ERR_SSL_VERSION_OR_CIPHER_MISMATCH),
        NAPI_NET_ERROR_CODE("ERR_SSL_RENEGOTIATION_REQUESTED",
            ArkWeb_NetError::ARKWEB_ERR_SSL_RENEGOTIATION_REQUESTED),
        NAPI_NET_ERROR_CODE("ERR_PROXY_AUTH_UNSUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_PROXY_AUTH_UNSUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_BAD_SSL_CLIENT_AUTH_CERT",
            ArkWeb_NetError::ARKWEB_ERR_BAD_SSL_CLIENT_AUTH_CERT),
        NAPI_NET_ERROR_CODE("ERR_CONNECTION_TIMED_OUT",
            ArkWeb_NetError::ARKWEB_ERR_CONNECTION_TIMED_OUT),
        NAPI_NET_ERROR_CODE("ERR_HOST_RESOLVER_QUEUE_TOO_LARGE",
            ArkWeb_NetError::ARKWEB_ERR_HOST_RESOLVER_QUEUE_TOO_LARGE),
        NAPI_NET_ERROR_CODE("ERR_SOCKS_CONNECTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_SOCKS_CONNECTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_SOCKS_CONNECTION_HOST_UNREACHABLE",
            ArkWeb_NetError::ARKWEB_ERR_SOCKS_CONNECTION_HOST_UNREACHABLE),
        NAPI_NET_ERROR_CODE("ERR_ALPN_NEGOTIATION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_ALPN_NEGOTIATION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_SSL_NO_RENEGOTIATION",
            ArkWeb_NetError::ARKWEB_ERR_SSL_NO_RENEGOTIATION),
        NAPI_NET_ERROR_CODE("ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES",
            ArkWeb_NetError::ARKWEB_ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES),
        NAPI_NET_ERROR_CODE("ERR_SSL_DECOMPRESSION_FAILURE_ALERT",
            ArkWeb_NetError::ARKWEB_ERR_SSL_DECOMPRESSION_FAILURE_ALERT),
        NAPI_NET_ERROR_CODE("ERR_SSL_BAD_RECORD_MAC_ALERT",
            ArkWeb_NetError::ARKWEB_ERR_SSL_BAD_RECORD_MAC_ALERT),
        NAPI_NET_ERROR_CODE("ERR_PROXY_AUTH_REQUESTED",
            ArkWeb_NetError::ARKWEB_ERR_PROXY_AUTH_REQUESTED),
        NAPI_NET_ERROR_CODE("ERR_PROXY_CONNECTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_PROXY_CONNECTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_MANDATORY_PROXY_CONFIGURATION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_MANDATORY_PROXY_CONFIGURATION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_PRECONNECT_MAX_SOCKET_LIMIT",
            ArkWeb_NetError::ARKWEB_ERR_PRECONNECT_MAX_SOCKET_LIMIT),
        NAPI_NET_ERROR_CODE("ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED",
            ArkWeb_NetError::ARKWEB_ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED),
        NAPI_NET_ERROR_CODE("ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY",
            ArkWeb_NetError::ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY),
        NAPI_NET_ERROR_CODE("ERR_PROXY_CERTIFICATE_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_PROXY_CERTIFICATE_INVALID),
        NAPI_NET_ERROR_CODE("ERR_NAME_RESOLUTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_NAME_RESOLUTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_NETWORK_ACCESS_DENIED",
            ArkWeb_NetError::ARKWEB_ERR_NETWORK_ACCESS_DENIED),
        NAPI_NET_ERROR_CODE("ERR_TEMPORARILY_THROTTLED",
            ArkWeb_NetError::ARKWEB_ERR_TEMPORARILY_THROTTLED),
        NAPI_NET_ERROR_CODE("ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT",
            ArkWeb_NetError::ARKWEB_ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT),
        NAPI_NET_ERROR_CODE("ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED),
        NAPI_NET_ERROR_CODE("ERR_MSG_TOO_BIG",
            ArkWeb_NetError::ARKWEB_ERR_MSG_TOO_BIG),
        NAPI_NET_ERROR_CODE("ERR_WS_PROTOCOL_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_WS_PROTOCOL_ERROR),
        NAPI_NET_ERROR_CODE("ERR_ADDRESS_IN_USE",
            ArkWeb_NetError::ARKWEB_ERR_ADDRESS_IN_USE),
        NAPI_NET_ERROR_CODE("ERR_SSL_HANDSHAKE_NOT_COMPLETED",
            ArkWeb_NetError::ARKWEB_ERR_SSL_HANDSHAKE_NOT_COMPLETED),
        NAPI_NET_ERROR_CODE("ERR_SSL_BAD_PEER_PUBLIC_KEY",
            ArkWeb_NetError::ARKWEB_ERR_SSL_BAD_PEER_PUBLIC_KEY),
        NAPI_NET_ERROR_CODE("ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN",
            ArkWeb_NetError::ARKWEB_ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN),
        NAPI_NET_ERROR_CODE("ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_SSL_DECRYPT_ERROR_ALERT",
            ArkWeb_NetError::ARKWEB_ERR_SSL_DECRYPT_ERROR_ALERT),
        NAPI_NET_ERROR_CODE("ERR_WS_THROTTLE_QUEUE_TOO_LARGE",
            ArkWeb_NetError::ARKWEB_ERR_WS_THROTTLE_QUEUE_TOO_LARGE),
        NAPI_NET_ERROR_CODE("ERR_SSL_SERVER_CERT_CHANGED",
            ArkWeb_NetError::ARKWEB_ERR_SSL_SERVER_CERT_CHANGED),
        NAPI_NET_ERROR_CODE("ERR_SSL_UNRECOGNIZED_NAME_ALERT",
            ArkWeb_NetError::ARKWEB_ERR_SSL_UNRECOGNIZED_NAME_ALERT),
        NAPI_NET_ERROR_CODE("ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR),
        NAPI_NET_ERROR_CODE("ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR),
        NAPI_NET_ERROR_CODE("ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE",
            ArkWeb_NetError::ARKWEB_ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE),
        NAPI_NET_ERROR_CODE("ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE",
            ArkWeb_NetError::ARKWEB_ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE),
        NAPI_NET_ERROR_CODE("ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT",
            ArkWeb_NetError::ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT),
        NAPI_NET_ERROR_CODE("ERR_ICANN_NAME_COLLISION",
            ArkWeb_NetError::ARKWEB_ERR_ICANN_NAME_COLLISION),
        NAPI_NET_ERROR_CODE("ERR_SSL_SERVER_CERT_BAD_FORMAT",
            ArkWeb_NetError::ARKWEB_ERR_SSL_SERVER_CERT_BAD_FORMAT),
        NAPI_NET_ERROR_CODE("ERR_CT_STH_PARSING_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_CT_STH_PARSING_FAILED),
        NAPI_NET_ERROR_CODE("ERR_CT_STH_INCOMPLETE",
            ArkWeb_NetError::ARKWEB_ERR_CT_STH_INCOMPLETE),
        NAPI_NET_ERROR_CODE("ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH",
            ArkWeb_NetError::ARKWEB_ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH),
        NAPI_NET_ERROR_CODE("ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED),
        NAPI_NET_ERROR_CODE("ERR_SSL_OBSOLETE_CIPHER",
            ArkWeb_NetError::ARKWEB_ERR_SSL_OBSOLETE_CIPHER),
        NAPI_NET_ERROR_CODE("ERR_WS_UPGRADE",
            ArkWeb_NetError::ARKWEB_ERR_WS_UPGRADE),
        NAPI_NET_ERROR_CODE("ERR_READ_IF_READY_NOT_IMPLEMENTED",
            ArkWeb_NetError::ARKWEB_ERR_READ_IF_READY_NOT_IMPLEMENTED),
        NAPI_NET_ERROR_CODE("ERR_NO_BUFFER_SPACE",
            ArkWeb_NetError::ARKWEB_ERR_NO_BUFFER_SPACE),
        NAPI_NET_ERROR_CODE("ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS",
            ArkWeb_NetError::ARKWEB_ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS),
        NAPI_NET_ERROR_CODE("ERR_EARLY_DATA_REJECTED",
            ArkWeb_NetError::ARKWEB_ERR_EARLY_DATA_REJECTED),
        NAPI_NET_ERROR_CODE("ERR_WRONG_VERSION_ON_EARLY_DATA",
            ArkWeb_NetError::ARKWEB_ERR_WRONG_VERSION_ON_EARLY_DATA),
        NAPI_NET_ERROR_CODE("ERR_TLS13_DOWNGRADE_DETECTED",
            ArkWeb_NetError::ARKWEB_ERR_TLS13_DOWNGRADE_DETECTED),
        NAPI_NET_ERROR_CODE("ERR_SSL_KEY_USAGE_INCOMPATIBLE",
            ArkWeb_NetError::ARKWEB_ERR_SSL_KEY_USAGE_INCOMPATIBLE),
        NAPI_NET_ERROR_CODE("ERR_INVALID_ECH_CONFIG_LIST",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_ECH_CONFIG_LIST),
        NAPI_NET_ERROR_CODE("ERR_ECH_NOT_NEGOTIATED",
            ArkWeb_NetError::ARKWEB_ERR_ECH_NOT_NEGOTIATED),
        NAPI_NET_ERROR_CODE("ERR_ECH_FALLBACK_CERTIFICATE_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_ECH_FALLBACK_CERTIFICATE_INVALID),
        NAPI_NET_ERROR_CODE("ERR_CERT_COMMON_NAME_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_CERT_COMMON_NAME_INVALID),
        NAPI_NET_ERROR_CODE("ERR_CERT_DATE_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_CERT_DATE_INVALID),
        NAPI_NET_ERROR_CODE("ERR_CERT_AUTHORITY_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_CERT_AUTHORITY_INVALID),
        NAPI_NET_ERROR_CODE("ERR_CERT_CONTAINS_ERRORS",
            ArkWeb_NetError::ARKWEB_ERR_CERT_CONTAINS_ERRORS),
        NAPI_NET_ERROR_CODE("ERR_CERT_NO_REVOCATION_MECHANISM",
            ArkWeb_NetError::ARKWEB_ERR_CERT_NO_REVOCATION_MECHANISM),
        NAPI_NET_ERROR_CODE("ERR_CERT_UNABLE_TO_CHECK_REVOCATION",
            ArkWeb_NetError::ARKWEB_ERR_CERT_UNABLE_TO_CHECK_REVOCATION),
        NAPI_NET_ERROR_CODE("ERR_CERT_REVOKED",
            ArkWeb_NetError::ARKWEB_ERR_CERT_REVOKED),
        NAPI_NET_ERROR_CODE("ERR_CERT_INVALID",
            ArkWeb_NetError::ARKWEB_ERR_CERT_INVALID),
        NAPI_NET_ERROR_CODE("ERR_CERT_WEAK_SIGNATURE_ALGORITHM",
            ArkWeb_NetError::ARKWEB_ERR_CERT_WEAK_SIGNATURE_ALGORITHM),
        NAPI_NET_ERROR_CODE("ERR_CERT_NON_UNIQUE_NAME",
            ArkWeb_NetError::ARKWEB_ERR_CERT_NON_UNIQUE_NAME),
        NAPI_NET_ERROR_CODE("ERR_CERT_WEAK_KEY",
            ArkWeb_NetError::ARKWEB_ERR_CERT_WEAK_KEY),
        NAPI_NET_ERROR_CODE("ERR_CERT_NAME_CONSTRAINT_VIOLATION",
            ArkWeb_NetError::ARKWEB_ERR_CERT_NAME_CONSTRAINT_VIOLATION),
        NAPI_NET_ERROR_CODE("ERR_CERT_VALIDITY_TOO_LONG",
            ArkWeb_NetError::ARKWEB_ERR_CERT_VALIDITY_TOO_LONG),
        NAPI_NET_ERROR_CODE("ERR_CERTIFICATE_TRANSPARENCY_REQUIRED",
            ArkWeb_NetError::ARKWEB_ERR_CERTIFICATE_TRANSPARENCY_REQUIRED),
        NAPI_NET_ERROR_CODE("ERR_CERT_SYMANTEC_LEGACY",
            ArkWeb_NetError::ARKWEB_ERR_CERT_SYMANTEC_LEGACY),
        NAPI_NET_ERROR_CODE("ERR_CERT_KNOWN_INTERCEPTION_BLOCKED",
            ArkWeb_NetError::ARKWEB_ERR_CERT_KNOWN_INTERCEPTION_BLOCKED),
        NAPI_NET_ERROR_CODE("ERR_SSL_OBSOLETE_VERSION_OR_CIPHER",
            ArkWeb_NetError::ARKWEB_ERR_SSL_OBSOLETE_VERSION_OR_CIPHER),
        NAPI_NET_ERROR_CODE("ERR_CERT_END",
            ArkWeb_NetError::ARKWEB_ERR_CERT_END),
        NAPI_NET_ERROR_CODE("ERR_INVALID_URL",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_URL),
        NAPI_NET_ERROR_CODE("ERR_DISALLOWED_URL_SCHEME",
            ArkWeb_NetError::ARKWEB_ERR_DISALLOWED_URL_SCHEME),
        NAPI_NET_ERROR_CODE("ERR_UNKNOWN_URL_SCHEME",
            ArkWeb_NetError::ARKWEB_ERR_UNKNOWN_URL_SCHEME),
        NAPI_NET_ERROR_CODE("ERR_INVALID_REDIRECT",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_REDIRECT),
        NAPI_NET_ERROR_CODE("ERR_TOO_MANY_REDIRECTS",
            ArkWeb_NetError::ARKWEB_ERR_TOO_MANY_REDIRECTS),
        NAPI_NET_ERROR_CODE("ERR_UNSAFE_REDIRECT",
            ArkWeb_NetError::ARKWEB_ERR_UNSAFE_REDIRECT),
        NAPI_NET_ERROR_CODE("ERR_UNSAFE_PORT",
            ArkWeb_NetError::ARKWEB_ERR_UNSAFE_PORT),
        NAPI_NET_ERROR_CODE("ERR_INVALID_RESPONSE",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_RESPONSE),
        NAPI_NET_ERROR_CODE("ERR_INVALID_CHUNKED_ENCODING",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_CHUNKED_ENCODING),
        NAPI_NET_ERROR_CODE("ERR_METHOD_UNSUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_METHOD_UNSUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_UNEXPECTED_PROXY_AUTH",
            ArkWeb_NetError::ARKWEB_ERR_UNEXPECTED_PROXY_AUTH),
        NAPI_NET_ERROR_CODE("ERR_EMPTY_RESPONSE",
            ArkWeb_NetError::ARKWEB_ERR_EMPTY_RESPONSE),
        NAPI_NET_ERROR_CODE("ERR_RESPONSE_HEADERS_TOO_BIG",
            ArkWeb_NetError::ARKWEB_ERR_RESPONSE_HEADERS_TOO_BIG),
        NAPI_NET_ERROR_CODE("ERR_PAC_SCRIPT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_PAC_SCRIPT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_REQUEST_RANGE_NOT_SATISFIABLE",
            ArkWeb_NetError::ARKWEB_ERR_REQUEST_RANGE_NOT_SATISFIABLE),
        NAPI_NET_ERROR_CODE("ERR_MALFORMED_IDENTITY",
            ArkWeb_NetError::ARKWEB_ERR_MALFORMED_IDENTITY),
        NAPI_NET_ERROR_CODE("ERR_CONTENT_DECODING_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_CONTENT_DECODING_FAILED),
        NAPI_NET_ERROR_CODE("ERR_NETWORK_IO_SUSPENDED",
            ArkWeb_NetError::ARKWEB_ERR_NETWORK_IO_SUSPENDED),
        NAPI_NET_ERROR_CODE("ERR_SYN_REPLY_NOT_RECEIVED",
            ArkWeb_NetError::ARKWEB_ERR_SYN_REPLY_NOT_RECEIVED),
        NAPI_NET_ERROR_CODE("ERR_ENCODING_CONVERSION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_ENCODING_CONVERSION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT",
            ArkWeb_NetError::ARKWEB_ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT),
        NAPI_NET_ERROR_CODE("ERR_NO_SUPPORTED_PROXIES",
            ArkWeb_NetError::ARKWEB_ERR_NO_SUPPORTED_PROXIES),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_PROTOCOL_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_PROTOCOL_ERROR),
        NAPI_NET_ERROR_CODE("ERR_INVALID_AUTH_CREDENTIALS",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_AUTH_CREDENTIALS),
        NAPI_NET_ERROR_CODE("ERR_UNSUPPORTED_AUTH_SCHEME",
            ArkWeb_NetError::ARKWEB_ERR_UNSUPPORTED_AUTH_SCHEME),
        NAPI_NET_ERROR_CODE("ERR_ENCODING_DETECTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_ENCODING_DETECTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_MISSING_AUTH_CREDENTIALS",
            ArkWeb_NetError::ARKWEB_ERR_MISSING_AUTH_CREDENTIALS),
        NAPI_NET_ERROR_CODE("ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS",
            ArkWeb_NetError::ARKWEB_ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS),
        NAPI_NET_ERROR_CODE("ERR_MISCONFIGURED_AUTH_ENVIRONMENT",
            ArkWeb_NetError::ARKWEB_ERR_MISCONFIGURED_AUTH_ENVIRONMENT),
        NAPI_NET_ERROR_CODE("ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS",
            ArkWeb_NetError::ARKWEB_ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS),
        NAPI_NET_ERROR_CODE("ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN",
            ArkWeb_NetError::ARKWEB_ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN),
        NAPI_NET_ERROR_CODE("ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH",
            ArkWeb_NetError::ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH),
        NAPI_NET_ERROR_CODE("ERR_INCOMPLETE_HTTP2_HEADERS",
            ArkWeb_NetError::ARKWEB_ERR_INCOMPLETE_HTTP2_HEADERS),
        NAPI_NET_ERROR_CODE("ERR_PAC_NOT_IN_DHCP",
            ArkWeb_NetError::ARKWEB_ERR_PAC_NOT_IN_DHCP),
        NAPI_NET_ERROR_CODE("ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION",
            ArkWeb_NetError::ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION),
        NAPI_NET_ERROR_CODE("ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION",
            ArkWeb_NetError::ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_SERVER_REFUSED_STREAM",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_SERVER_REFUSED_STREAM),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_PING_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_PING_FAILED),
        NAPI_NET_ERROR_CODE("ERR_CONTENT_LENGTH_MISMATCH",
            ArkWeb_NetError::ARKWEB_ERR_CONTENT_LENGTH_MISMATCH),
        NAPI_NET_ERROR_CODE("ERR_INCOMPLETE_CHUNKED_ENCODING",
            ArkWeb_NetError::ARKWEB_ERR_INCOMPLETE_CHUNKED_ENCODING),
        NAPI_NET_ERROR_CODE("ERR_QUIC_PROTOCOL_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_QUIC_PROTOCOL_ERROR),
        NAPI_NET_ERROR_CODE("ERR_RESPONSE_HEADERS_TRUNCATED",
            ArkWeb_NetError::ARKWEB_ERR_RESPONSE_HEADERS_TRUNCATED),
        NAPI_NET_ERROR_CODE("ERR_QUIC_HANDSHAKE_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_QUIC_HANDSHAKE_FAILED),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_FLOW_CONTROL_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_FLOW_CONTROL_ERROR),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_FRAME_SIZE_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_FRAME_SIZE_ERROR),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_COMPRESSION_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_COMPRESSION_ERROR),
        NAPI_NET_ERROR_CODE("ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION",
            ArkWeb_NetError::ARKWEB_ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION),
        NAPI_NET_ERROR_CODE("ERR_HTTP_1_1_REQUIRED",
            ArkWeb_NetError::ARKWEB_ERR_HTTP_1_1_REQUIRED),
        NAPI_NET_ERROR_CODE("ERR_PROXY_HTTP_1_1_REQUIRED",
            ArkWeb_NetError::ARKWEB_ERR_PROXY_HTTP_1_1_REQUIRED),
        NAPI_NET_ERROR_CODE("ERR_PAC_SCRIPT_TERMINATED",
            ArkWeb_NetError::ARKWEB_ERR_PAC_SCRIPT_TERMINATED),
        NAPI_NET_ERROR_CODE("ERR_INVALID_HTTP_RESPONSE",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_HTTP_RESPONSE),
        NAPI_NET_ERROR_CODE("ERR_CONTENT_DECODING_INIT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_CONTENT_DECODING_INIT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER),
        NAPI_NET_ERROR_CODE("ERR_TOO_MANY_RETRIES",
            ArkWeb_NetError::ARKWEB_ERR_TOO_MANY_RETRIES),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_STREAM_CLOSED",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_STREAM_CLOSED),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_CLIENT_REFUSED_STREAM",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_CLIENT_REFUSED_STREAM),
        NAPI_NET_ERROR_CODE("ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH",
            ArkWeb_NetError::ARKWEB_ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH),
        NAPI_NET_ERROR_CODE("ERR_HTTP_RESPONSE_CODE_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_HTTP_RESPONSE_CODE_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_QUIC_UNKNOWN_CERT_ROOT",
            ArkWeb_NetError::ARKWEB_ERR_QUIC_UNKNOWN_CERT_ROOT),
        NAPI_NET_ERROR_CODE("ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED",
            ArkWeb_NetError::ARKWEB_ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED),
        NAPI_NET_ERROR_CODE("ERR_TOO_MANY_ACCEPT_CH_RESTARTS",
            ArkWeb_NetError::ARKWEB_ERR_TOO_MANY_ACCEPT_CH_RESTARTS),
        NAPI_NET_ERROR_CODE("ERR_INCONSISTENT_IP_ADDRESS_SPACE",
            ArkWeb_NetError::ARKWEB_ERR_INCONSISTENT_IP_ADDRESS_SPACE),
        NAPI_NET_ERROR_CODE("ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY",
            ArkWeb_NetError::ARKWEB_ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY),
        NAPI_NET_ERROR_CODE("ERR_CACHE_MISS",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_MISS),
        NAPI_NET_ERROR_CODE("ERR_CACHE_READ_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_READ_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_WRITE_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_WRITE_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_OPERATION_UNSUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_OPERATION_UNSUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_CACHE_OPEN_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_OPEN_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_CREATE_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_CREATE_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_RACE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_RACE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_CHECKSUM_READ_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_CHECKSUM_READ_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_CHECKSUM_MISMATCH",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_CHECKSUM_MISMATCH),
        NAPI_NET_ERROR_CODE("ERR_CACHE_LOCK_TIMEOUT",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_LOCK_TIMEOUT),
        NAPI_NET_ERROR_CODE("ERR_CACHE_AUTH_FAILURE_AFTER_READ",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_AUTH_FAILURE_AFTER_READ),
        NAPI_NET_ERROR_CODE("ERR_CACHE_ENTRY_NOT_SUITABLE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_ENTRY_NOT_SUITABLE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_DOOM_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_DOOM_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_CACHE_OPEN_OR_CREATE_FAILURE",
            ArkWeb_NetError::ARKWEB_ERR_CACHE_OPEN_OR_CREATE_FAILURE),
        NAPI_NET_ERROR_CODE("ERR_INSECURE_RESPONSE",
            ArkWeb_NetError::ARKWEB_ERR_INSECURE_RESPONSE),
        NAPI_NET_ERROR_CODE("ERR_NO_PRIVATE_KEY_FOR_CERT",
            ArkWeb_NetError::ARKWEB_ERR_NO_PRIVATE_KEY_FOR_CERT),
        NAPI_NET_ERROR_CODE("ERR_ADD_USER_CERT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_ADD_USER_CERT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_INVALID_SIGNED_EXCHANGE",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_SIGNED_EXCHANGE),
        NAPI_NET_ERROR_CODE("ERR_INVALID_WEB_BUNDLE",
            ArkWeb_NetError::ARKWEB_ERR_INVALID_WEB_BUNDLE),
        NAPI_NET_ERROR_CODE("ERR_TRUST_TOKEN_OPERATION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_TRUST_TOKEN_OPERATION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST",
            ArkWeb_NetError::ARKWEB_ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST),
        NAPI_NET_ERROR_CODE("ERR_FTP_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_FTP_FAILED),
        NAPI_NET_ERROR_CODE("ERR_FTP_SERVICE_UNAVAILABLE",
            ArkWeb_NetError::ARKWEB_ERR_FTP_SERVICE_UNAVAILABLE),
        NAPI_NET_ERROR_CODE("ERR_FTP_TRANSFER_ABORTED",
            ArkWeb_NetError::ARKWEB_ERR_FTP_TRANSFER_ABORTED),
        NAPI_NET_ERROR_CODE("ERR_FTP_FILE_BUSY",
            ArkWeb_NetError::ARKWEB_ERR_FTP_FILE_BUSY),
        NAPI_NET_ERROR_CODE("ERR_FTP_SYNTAX_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_FTP_SYNTAX_ERROR),
        NAPI_NET_ERROR_CODE("ERR_FTP_COMMAND_UNSUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_FTP_COMMAND_UNSUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_FTP_BAD_COMMAND_SEQUENCE",
            ArkWeb_NetError::ARKWEB_ERR_FTP_BAD_COMMAND_SEQUENCE),
        NAPI_NET_ERROR_CODE("ERR_PKCS12_IMPORT_BAD_PASSWORD",
            ArkWeb_NetError::ARKWEB_ERR_PKCS12_IMPORT_BAD_PASSWORD),
        NAPI_NET_ERROR_CODE("ERR_PKCS12_IMPORT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_PKCS12_IMPORT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_IMPORT_CA_CERT_NOT_CA",
            ArkWeb_NetError::ARKWEB_ERR_IMPORT_CA_CERT_NOT_CA),
        NAPI_NET_ERROR_CODE("ERR_IMPORT_CERT_ALREADY_EXISTS",
            ArkWeb_NetError::ARKWEB_ERR_IMPORT_CERT_ALREADY_EXISTS),
        NAPI_NET_ERROR_CODE("ERR_IMPORT_CA_CERT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_IMPORT_CA_CERT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_IMPORT_SERVER_CERT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_IMPORT_SERVER_CERT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_PKCS12_IMPORT_INVALID_MAC",
            ArkWeb_NetError::ARKWEB_ERR_PKCS12_IMPORT_INVALID_MAC),
        NAPI_NET_ERROR_CODE("ERR_PKCS12_IMPORT_INVALID_FILE",
            ArkWeb_NetError::ARKWEB_ERR_PKCS12_IMPORT_INVALID_FILE),
        NAPI_NET_ERROR_CODE("ERR_PKCS12_IMPORT_UNSUPPORTED",
            ArkWeb_NetError::ARKWEB_ERR_PKCS12_IMPORT_UNSUPPORTED),
        NAPI_NET_ERROR_CODE("ERR_KEY_GENERATION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_KEY_GENERATION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_PRIVATE_KEY_EXPORT_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_PRIVATE_KEY_EXPORT_FAILED),
        NAPI_NET_ERROR_CODE("ERR_SELF_SIGNED_CERT_GENERATION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_SELF_SIGNED_CERT_GENERATION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_CERT_DATABASE_CHANGED",
            ArkWeb_NetError::ARKWEB_ERR_CERT_DATABASE_CHANGED),
        NAPI_NET_ERROR_CODE("ERR_CERT_VERIFIER_CHANGED",
            ArkWeb_NetError::ARKWEB_ERR_CERT_VERIFIER_CHANGED),
        NAPI_NET_ERROR_CODE("ERR_DNS_MALFORMED_RESPONSE",
            ArkWeb_NetError::ARKWEB_ERR_DNS_MALFORMED_RESPONSE),
        NAPI_NET_ERROR_CODE("ERR_DNS_SERVER_REQUIRES_TCP",
            ArkWeb_NetError::ARKWEB_ERR_DNS_SERVER_REQUIRES_TCP),
        NAPI_NET_ERROR_CODE("ERR_DNS_SERVER_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_DNS_SERVER_FAILED),
        NAPI_NET_ERROR_CODE("ERR_DNS_TIMED_OUT",
            ArkWeb_NetError::ARKWEB_ERR_DNS_TIMED_OUT),
        NAPI_NET_ERROR_CODE("ERR_DNS_CACHE_MISS",
            ArkWeb_NetError::ARKWEB_ERR_DNS_CACHE_MISS),
        NAPI_NET_ERROR_CODE("ERR_DNS_SEARCH_EMPTY",
            ArkWeb_NetError::ARKWEB_ERR_DNS_SEARCH_EMPTY),
        NAPI_NET_ERROR_CODE("ERR_DNS_SORT_ERROR",
            ArkWeb_NetError::ARKWEB_ERR_DNS_SORT_ERROR),
        NAPI_NET_ERROR_CODE("ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED",
            ArkWeb_NetError::ARKWEB_ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED),
        NAPI_NET_ERROR_CODE("ERR_DNS_NAME_HTTPS_ONLY",
            ArkWeb_NetError::ARKWEB_ERR_DNS_NAME_HTTPS_ONLY),
        NAPI_NET_ERROR_CODE("ERR_DNS_REQUEST_CANCELED",
            ArkWeb_NetError::ARKWEB_ERR_DNS_REQUEST_CANCELED),
        NAPI_NET_ERROR_CODE("ERR_DNS_NO_MATCHING_SUPPORTED_ALPN",
            ArkWeb_NetError::ARKWEB_ERR_DNS_NO_MATCHING_SUPPORTED_ALPN),
    };
    napi_define_class(env, WEB_NET_ERROR_CODE.c_str(), WEB_NET_ERROR_CODE.length(),
        CreateEnumConstructor, nullptr,
        sizeof(properties) / sizeof(properties[0]),
        properties, &webNetErrorCode);
    napi_set_named_property(env, *exportsPointer, WEB_NET_ERROR_CODE.c_str(), webNetErrorCode);
}
}